<{include file="header.html"}>

<script type="text/javascript">

	function validate()
	{
		var title = document.getElementById('TITLE');
        var code = document.getElementById('CODE');
        var content = document.getElementsByName('CONTENT')[0];

		// update content of CKEDITOR to textareas
		CKEDITOR.instances.CONTENT.updateElement();

		// checking Code
		if(isEmptyTextBox(code, '<{$smarty.const._MSG_CODE_IS_EMPTY|utf8_escape_js}>'))
			return false;

		// checking title
		if(!isValidLengthTextBox(title, <{$smarty.const.MAX_LENGTH_NAME}>, '<{$smarty.const._MSG_CODE_IS_TOO_LONG|utf8_escape_js}>')){
            return false;
        }
        
        if(isEmptyTextBox(title, '<{$smarty.const._MSG_TITLE_IS_EMPTY|utf8_escape_js}>'))
			return false;

		// checking CONTENT
		if(isEmptyTextBox(content, '<{$smarty.const._MSG_CONTENT_IS_EMPTY|utf8_escape_js}>'))
			return false;

		document.user_form.submit();
	}



</script>

		<div class="box_two_third">
			<div class="box_head"><{$smarty.const._LB_STATIC_PAGE_MANAGEMENT|utf8_escape_html}></div>
			<div class="box_content">

				<form action="<{$smarty.server.REQUEST_URI}>" method="post" name="user_form">
				<input type="hidden" id="ID" value="<{$page->ID}>"/>
				<input type="hidden" id="act" name="act" value="<{$smarty.const.ACT_VALID_EDIT}>"/>
				<table>
					<tr>
						<td width="100"><{$smarty.const._LB_CODE|utf8_escape_html}>&nbsp;:&nbsp;<{$smarty.const._LB_REQUIRE_FIELD}></td>
						<td colspan="3"><input name="CODE" id="CODE" type="text" size="<{$smarty.const.SIZE_NAME}>" value="<{$page->CODE|utf8_escape_html}>" /></td>
					</tr>
                    <tr>
						<td ><{$smarty.const._LB_TITLE|utf8_escape_html}>&nbsp;:&nbsp;<{$smarty.const._LB_REQUIRE_FIELD}></td>
						<td colspan="3"><input name="TITLE" id="TITLE" type="text" size="50" value="<{$page->TITLE|utf8_escape_html}>" /></td>
					</tr>
                    <tr>
						<td ><{$smarty.const._LB_CONTENT|utf8_escape_html}>&nbsp;:&nbsp;<{$smarty.const._LB_REQUIRE_FIELD}></td>
						<td colspan="3">
                            <{$CKEditor->editor("CONTENT",$page->CONTENT)}>
                        </td>
					</tr>
                    <tr>
						<td ><{$smarty.const._LB_DISABLED|utf8_escape_html}>&nbsp;:&nbsp;</td>
						<td colspan="3"><input type="checkbox" value="1" name="DISABLED" <{if $page->DISABLED}>checked<{/if}>/></td>
					</tr>
					<tr>
						  <td class="submit" colspan="4" style="padding-top:10px"><br />
								<a class="tribullet" href="<{$backlink}>"><{$smarty.const._LB_BACK}></a>
								<a class="tribullet" href="#" onclick="validate()"><{$smarty.const._LB_VALIDATE}></a>
							</td>
						</tr>

				</table>
				</form>

			</div>
		</div>
<{include file="footer.html"}>
